<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
    <head>
        <meta charset="UTF-8">
        <title>连接数据库</title>
    </head>
    <body>
        <?php
       $host="127.0.0.1";
       $user="root";
       $password="";
       $database="db_bbs";
       $port="3306";
       $db=new mysqli($host, $user, $password, $database, $port);
       if ($db->connect_errno){
           die("连接失败！失败的原因为".$db->connect_errno);
       }
       else
       {
           echo "连接成功！";
       }
        ?>
    </body>
</html>
